﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Caifu.Spiders
{
	/// <summary>
	/// 采集服务
	/// </summary>
	public class SpiderService
	{
		/// <summary>
		/// 运行采集
		/// </summary>
		public static void Run()
		{
			// 期望日期
			DateTime date;
			if (!DateUtil.NowIsSpiderTime(out date))
			{
				return;
			}

			Caifu.Spiders.GetHexun.RunSpider(date);
			Caifu.Spiders.GetJrj.RunSpider(date);
			Caifu.Spiders.GetEtf88.RunSpider(date);
		}

		public static void Run(DateTime date)
		{
			Caifu.Spiders.GetHexun.RunSpider(date);
			Caifu.Spiders.GetJrj.RunSpider(date);
			Caifu.Spiders.GetEtf88.RunSpider(date);
		}
	}
}
